<template>
    <span class="span2">我是首页</span>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
    name: 'routeTest1Home'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import { onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
//数据
let router = useRouter()
//方法
onMounted(() => {
    console.log('首页挂载后')
    setTimeout(() => {
        console.log('首页挂载3秒后')
        //编程式路由导航
        router.push('/routeHome/routeTest1/routeTest1Page1')
    }, 3000);
})
onUnmounted(() => {
    console.log('首页卸载后')
})
</script>

<!-- 样式 -->
<style scoped></style>